package org.pzy.dubbo.provider;

import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.ServiceConfig;
import org.pzy.dubbo.api.GreetingService;

import java.util.concurrent.CountDownLatch;

/**
 * @Author: DRevelation
 * @Date: 2022/6/1 10:06
 */
public class Application {
    public static void main(String[] args) throws InterruptedException {
        ServiceConfig<GreetingService> config = new ServiceConfig<>();
        config.setApplication(new ApplicationConfig("first-dubbo-provider"));
        config.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
        config.setInterface(GreetingService.class);
        config.setRef(new GreetingServiceImpl());
        config.export();

        System.out.println("dubbo service started");
        new CountDownLatch(1).await();
    }
}
